-- GENERATED SPELL FOR [Hagg Taurenbane] --


function spell0_5859(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40505,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5859', 572, 1)
end

function spell1_5859(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(13730,pUnit)
pUnit:RegisterEvent('Sorts_5859', 30268, 1)
end

function spell2_5859(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5859', 10345, 1)
end

function Sorts_5859(pUnit, Event)
local choix_sorts_5859 = math.random(0, 2)
if choix_sorts_5859 == 0 then
pUnit:RegisterEvent('spell0_5859', 1, 1)
end
if choix_sorts_5859 == 1 then
pUnit:RegisterEvent('spell1_5859', 1, 1)
end
if choix_sorts_5859 == 2 then
pUnit:RegisterEvent('spell2_5859', 1, 1)
end
end

function mob5859_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5859', math.random(1500, 3000), 1)
end

function mob5859_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5859_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5859_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5859, 1, 'mob5859_Action')
RegisterUnitEvent(5859, 2, 'mob5859_Leave')
RegisterUnitEvent(5859, 3, 'mob5859_Kill')
RegisterUnitEvent(5859, 4, 'mob5859_Die')
